
package com.ddyx.service.product.api.feign.factory;

import com.ddyx.service.product.api.feign.RemoteProductClient;
import com.ddyx.service.product.api.feign.fallback.RemoteProductClientFallback;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteProductClientFallbackFactory implements FallbackFactory<RemoteProductClient> {

	@Override
	public RemoteProductClient create(Throwable throwable) {
		RemoteProductClientFallback productClientFallback = new RemoteProductClientFallback();
		productClientFallback.setCause(throwable);
		return productClientFallback;
	}
}
